package com.ztools.pc.provider;

import com.ztools.api.service.pc.PcStoreService;
import com.ztools.common.model.pc.store.OnlineStock;
import com.ztools.common.model.pc.store.StoreSale;
import com.ztools.pc.service.store.OnlineStockService;
import com.ztools.pc.service.store.StoreSaleService;
import org.apache.dubbo.config.annotation.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: seeTools
 * @Date: 2023/5/30  14:51
 * @Version 1.0
 */
@Service(version = "1.0", timeout = 3000)
public class PcStoreServiceImpl implements PcStoreService {

    @Resource
    private OnlineStockService onlineStockService;
    @Resource
    private StoreSaleService storeSaleService;

    @Override
    public List<OnlineStock> getStoreMall() {
        return onlineStockService.getStoreMall();
    }

    @Override
    public List<StoreSale> getStoreSale(Long memberId) {
        StoreSale storeSale = StoreSale.builder().memberId(memberId).build();
        return storeSaleService.findByObject(storeSale);
    }

}
